package 位运算;
/*https://leetcode.cn/problems/hamming-distance/description/*/
public class 汉明距离 {
    public int hammingDistance(int x, int y) {

        int s = x ^ y, ret = 0;
        while (s != 0) {
            s = s & (s - 1);
            ret++;
        }
            return ret;




    }
}
